package com.wkbb.sports.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.wkbb.common.handler.JsonUtil;
import com.wkbb.sports.dto.TrainStudentDetailDto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author lbh
 * @date 2021年03月29日 17:58:34
 * @description: hlife_student_practice  学生练习记录表
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class HlifeStudentPractice extends BaseEntity{

    @ApiModelProperty(value = "编号")
    private Long id;
    @ApiModelProperty(value = "学生作业记录ID")
    private Long workStudentHistoryId;
    @ApiModelProperty(value = "模式(1限时模式 2限数模式 3自由模式)",required = true)
    private Integer modelType;
    @ApiModelProperty(value = "模式名称")
    private String modelTypeName;
    @ApiModelProperty(value = "用户类型 1学生 2爸爸 3妈妈 4其他")
    private Integer userType;
    @ApiModelProperty(value = "成绩评级：1优秀 2良好 3及格 4不及格")
    private Integer scoreLevel;
    @ApiModelProperty(value = "运动类型：0普通运动 1作业 2擂台 3挑战 4房间玩法")
    private Integer sportType;
    @ApiModelProperty(value = "要求时间（秒） or 要求次数")
    private Integer trainRequire;
    @ApiModelProperty(value = "累计平均心率")
    private Integer avgHeartRate;
    @ApiModelProperty(value = "视频地址")
    private String videoUrl;

    @ApiModelProperty(value = "学校ID")
    private Long orgId;
    @ApiModelProperty(value = "项目ID   跳绳传1")
    private Byte projectKind;
    @ApiModelProperty(value = "年级ID")
    private Long gradeId;
    @ApiModelProperty(value = "年级名称")
    private String gradeName;
    @ApiModelProperty(value = "班级ID")
    private Long classId;
    @ApiModelProperty(value = "学生头像地址")
    private String headImgUrl;
    @ApiModelProperty(value = "班级名称")
    private String className;
    @ApiModelProperty(value = "学生ID")
    private Long studentId;
    @ApiModelProperty(value = "跳绳类型 1速度跳绳 2花样跳绳")
    private Integer jumpType;
    @ApiModelProperty(value = "学生名称")
    private String studentName;
    @ApiModelProperty(value = "性别(1男/2女)")
    private Byte sex;
    @ApiModelProperty(value = "成绩")
    private Double achivement;
    @ApiModelProperty(value = "得分")
    private Double score;
    @ApiModelProperty(value = "加分项得分")
    private Double plusesScore;
    @ApiModelProperty(value = "实际时长(单位：秒)")
    private Integer actualTime;
    @ApiModelProperty(value = "状态 0、开始挑战 1、通过挑战 2、挑战失败")
    private Integer state;
    @ApiModelProperty(value = "工号或学号")
    private String userNo;
    @ApiModelProperty(value = "运动 扩展字段")
    private String ext;
    @ApiModelProperty(value = "训练详情，跳绳每次耗时（毫秒）情况、JSON字符串（例：[{\"seqNo\":1,\"timeStamp\":500},{\"seqNo\":2,\"timeStamp\":511}]）")
    private String details;
    @ApiModelProperty(value = "平均耗时（毫秒）")
    private Integer avgTime;
    @ApiModelProperty(value = "有效平均值(中位数)")
    private Integer medianTime;
    @ApiModelProperty(value = "失误 损失次数")
    private Integer lossesCount1;
    @ApiModelProperty(value = "甩绳速度偏慢 损失次数")
    private Integer lossesCount2;
    @ApiModelProperty(value = "进入状态过慢 损失次数")
    private Integer lossesCount3;

    private Long workId;
    private Long arenaId;
    private Long levelId;

    public Integer getSportType() {
        if (sportType == null) return 0;
        return sportType;
    }

    //    public static void main(String[] args) {
//        HlifeStudentPractice studentPractice = new HlifeStudentPractice();
//        studentPractice.setModelType(1);
//        studentPractice.setTrainRequire(60);
//        studentPractice.setAvgHeartRate(111);
//        studentPractice.setVideoUrl("https://qiniu.childrenonline.cn/1637582626102.mp4");
//        studentPractice.setStudentId(37L);
//        studentPractice.setAchivement(155.0);
//        studentPractice.setActualTime(60);
//        System.out.println(JsonUtil.objectToJson(studentPractice));
//    }

}
